/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package muhnes.sizoo.filtros;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

/**
 * Clase para realizar los filtros dependiendo de la seccion que haya
 * empezado
 */
public class InicializadorSesionFilter implements Filter { 
 
    @Override
    public void doFilter(ServletRequest request,
                         ServletResponse response,
                         FilterChain chain)
            throws IOException, ServletException {
 
        try {
            HttpServletRequest req = (HttpServletRequest)request;
            req.getSession(true);
            chain.doFilter(request, response); 
        } catch (Throwable ex) {
            throw new ServletException(ex);
        }
    }
 
    @Override
    public void init(FilterConfig filterConfig) {}
 
    @Override
    public void destroy() {}
 
}
